home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat 1997 January
/
macformat46.iso
/
Shareware Plus
/
Developers
/
EnterAct
/
EnterAct Stuff
/
Drag_on Modules
/
hAWK programs
/
$LineCount
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1992-05-24
|
358 b
|
23 lines
#$LineCount: get lines in each input file, and total up at the end
#Use MFS input option, and show stdout.
FNR == 1{
if (count+0 > 0)
{
print names[n] ":", count
total += count
count = 0
}
n = split(FILENAME, names, ":")
}
{++count}
END {
if (count+0 > 0)
{
print names[n] ":", count
total += count
}
print "Total lines:", total
}